package com.bigknow.appstore.web.base.controller;

import com.bigknow.appstore.web.base.entity.User;
import com.bigknow.appstore.web.base.service.IUserService;
import com.bigknow.appstore.web.base.vo.FancyTreeVo;
import com.bigknow.appstore.web.framework.controller.AbstractRestController;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * Created by Administrator on 2015/3/2.
 */
@RestController//采用RestController避免的在每个方法上门用 responseBody
@RequestMapping(value = "/base/user")
public class UserController extends AbstractRestController<User,IUserService> {
    @Override
    protected String getBasePath() {
        return "/base";
    }

    @Override
    protected String getBaseName() {
        return "user";
    }

    @RequestMapping("/rest/listTree")
    public List<FancyTreeVo> listTree() {
        return this.service.findAllForTree();
    }
}
